package com.lahuan.demo.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lahuan.config.aop.mycache.MyCache;
import com.lahuan.demo.entity.TestStudent;
import com.lahuan.demo.service.TestStudentService;
import com.lahuan.demo.mapper.TestStudentMapper;
import org.springframework.stereotype.Service;
import lombok.RequiredArgsConstructor;

import java.util.List;

/**
* <p>
* 学生服务实现类
* </p>
* @author lahuan
* @since 2021-12-04
*/
@RequiredArgsConstructor
@Service
public class TestStudentServiceImpl extends ServiceImpl<TestStudentMapper, TestStudent> implements TestStudentService {

    @MyCache(10)
    @Override
    public List<TestStudent> getAll() {
        return list();
    }

    @MyCache(10)
    @Override
    public TestStudent getStudentById(Long id) {
        return getById(id);
    }

    /**
     * 获取QueryWrapper对象
     * @return QueryWrapper对象
     */
    @Override
    public QueryWrapper<TestStudent> getQueryWrapper(){
        return Wrappers.<TestStudent>query();
    }

    /**
     * 获取Lambda形式的Wrapper对象
     * @return Lambda形式的Wrapper对象
     */
    @Override
    public  LambdaQueryWrapper<TestStudent> getLambdaWrapper(){
    return  Wrappers.<TestStudent>lambdaQuery();
    }

}
